<template>
  <a-layout-content style="margin-bottom: 100px">
    <h2>工单详情页</h2>
<!--    用户提交工单信息-->
    <a-row>
      <a-col :span="23">
        <WorkOrderInfo
        :workorder_info="workorder_info"
        ></WorkOrderInfo>
      </a-col>
    </a-row>

<!--    显示审批步骤-->
    <a-row>
      <a-col :span="23">

      </a-col>
    </a-row>

<!--    显示具体审批-->
    <a-row>
      <a-col :span="23">
        <SubOrderList
        :suborder_list="suborder_list"
        @initList="initList"
        ></SubOrderList>
      </a-col>
    </a-row>
  </a-layout-content>


</template>

<script>


export default {
  data(){
    return {
      workorder_id: '',
      workorder_info: {},
      suborder_list: [],
    }
  },
  components:{
    SubOrderList,
    WorkOrderInfo,
  },
  created(){
    this.workorder_id = this.$route.params.id
    this.initList()
  },
  methods:{

    initList(){
      console.log('initLIst')
      getSubOrderList({workorder_id:this.workorder_id}).then(resp =>{
        console.log(resp)
        this.workorder_info = resp.results.workorder_info;
        this.suborder_list = resp.results.suborder_list;
      }).catch(err =>{
        alert(err)
      })
    }

  }
}
</script>

<style scoped>

</style>
